#ifndef UI_CURSES_H
#define UI_CURSES_H   
#endif /* UI_CURSES_H */

/* ncurses ui object */
typedef struct {
    WINDOW *mainwnd;
    WINDOW *mainpad;
    int content_height; /* content is text */
    char *content_template;
} UI;

typedef struct {
    int cury;
    int itemheight;
    char *title;
} List_item;

typedef struct {
    int pheight; /* height in pixels */
} Window_content;

UI *ui_new();
void ui_delete(UI *u);

void ui_init_and_run(UI *u);
void ui_run(UI *u, char*);
int ui_handle_keystroke(UI *u, int ch);

/* returns the height of the wrapped text */
void ui_update_content(UI *u, char *text, int screenw);
void ui_generate_height(UI *u, char *text, int screenw);

List_item *list_item_new();
void list_item_delete(List_item *litem);
void list_item_add(UI *u, List_item *litem);
